load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = [
    "//rs/p2p:__subpackages__",
])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/crypto/temp_crypto",
    "//rs/crypto/tls_interfaces",
    "//rs/interfaces",
    "//rs/interfaces/mocks",
    "//rs/monitoring/logger",
    "//rs/monitoring/metrics",
    "//rs/p2p/artifact_downloader",
    "//rs/p2p/artifact_manager",
    "//rs/p2p/consensus_manager",
    "//rs/p2p/peer_manager",
    "//rs/p2p/quic_transport",
    "//rs/p2p/state_sync_manager",
    "//rs/protobuf",
    "//rs/registry/fake",
    "//rs/registry/keys",
    "//rs/registry/local_registry",
    "//rs/registry/proto_data_provider",
    "//rs/state_manager",
    "//rs/test_utilities/registry",
    "//rs/test_utilities/types",
    "//rs/types/base_types",
    "//rs/types/types",
    "//rs/types/types_test_utils",
    "@crate_index//:axum",
    "@crate_index//:bytes",
    "@crate_index//:futures",
    "@crate_index//:mockall",
    "@crate_index//:pin-project-lite",
    "@crate_index//:quinn",
    "@crate_index//:quinn-udp",
    "@crate_index//:rcgen",
    "@crate_index//:rustls",
    "@crate_index//:serde",
    "@crate_index//:slog",
    "@crate_index//:tempfile",
    "@crate_index//:tokio",
    "@crate_index//:tokio-stream",
    "@crate_index//:turmoil",
]

MACRO_DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:async-trait",
]

rust_library(
    name = "test_utils",
    testonly = True,
    srcs = glob(["src/**"]),
    crate_name = "ic_p2p_test_utils",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.9.0",
    deps = DEPENDENCIES,
)
